package com.fg.tliaswebmanagement.controller;

import com.fg.tliaswebmanagement.common.Result;
import com.fg.tliaswebmanagement.utils.JwtUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/login")
public class LoginController {

    @PostMapping
    public Result login() {
        System.out.println("执行登录了。。。");
        Map<String,Object> user = new HashMap<>();
        user.put("id",1);
        user.put("username","admin");
        user.put("password","123456");
        user.put("nickname","张三");
        return Result.success(JwtUtils.generateToken(user));
    }
}
